home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rwvector.lha / RWVector2.1 / rw / FLUDecomp.h < prev    next >
C/C++ Source or Header  |  1989-08-18  |  1KB  |  52 lines

  1. #ifndef FLUDECOMP_H
  2. #define FLUDECOMP_H
  3. #pragma once 
  4.  
  5. /*
  6.  *    Declarations for float precision LU Decomposition
  7.  *
  8.  *    Copyright (C) 1988, 1989.
  9.  *
  10.  *    Dr. Thomas Keffer
  11.  *    Rogue Wave Associates
  12.  *    P.O. Box 85341
  13.  *    Seattle WA 98145-1341
  14.  *
  15.  *    Permission to use, copy, modify, and distribute this
  16.  *    software and its documentation for any purpose and
  17.  *    without fee is hereby granted, provided that the
  18.  *    above copyright notice appear in all copies and that
  19.  *    both that copyright notice and this permission notice
  20.  *    appear in supporting documentation.
  21.  *    
  22.  *    This software is provided "as is" without any
  23.  *    expressed or implied warranty.
  24.  *
  25.  *
  26.  *    @(#)FLUDecomp.h    2.1    8/18/89
  27.  */
  28.  
  29. #include "FGEMatrix.h"
  30.  
  31. class FLUDecomp : FGEMatrix {
  32.   fortran_int*        ipvt;    // Pivot indices
  33.   fortran_int        info;
  34.   fortran_int        order;
  35.  
  36.   FGEMatrix        copy()    {return FGEMatrix::copy();}
  37.   float*        data()    {return FGEMatrix::data();}
  38. protected:
  39.   void            assertDefined();
  40.   void            assertPivots();
  41. public:
  42.   FLUDecomp(const FGEMatrix&);
  43.   ~FLUDecomp()    {delete ipvt;}
  44.  
  45.   // Matrix algebra declarations:
  46.   friend float            determinant(const FLUDecomp&);
  47.   friend FGEMatrix        inverse(const FLUDecomp&);
  48.   friend FloatVec        solve(const FLUDecomp&, const FloatVec&);
  49. };
  50.  
  51. #endif FLUDECOMP_H
  52.